
import { Tools } from 'weaver-mobile';

//获取列表数据
export const getList = (params = {}, menuType) => {
	if (menuType == '1') {
		return Tools.callApi({url:'/api/offical/receiveDoc/getList',  method:'POST', params});
	} else {
	return Tools.callApi({url:'/api/offical/sendDoc/getList',  method:'POST', params});
	}
}

//获取tabs
export const getTabs = (params = {}, menuType) => {
	if (menuType == '1') {
		return Tools.callApi({url:'/api/offical/receiveDoc/getBaseinfo',  method:'POST', params});
	} else {
	return Tools.callApi({url:'/api/offical/sendDoc/getBaseinfo',  method:'POST', params});
	}
}


//发送公文
export const sendDoc = (params = {}) => {
	return Tools.callApi({url:'/api/offical/sendDoc/sendDoc',  method:'POST', params});
}

//发送其他单位
export const sendOtherUnits = (params = {}) => {
	return Tools.callApi({url:'/api/offical/sendDoc/resendDoc',  method:'POST', params});
}

//作废、拒收、退回、撤销
export const cancelledDoc = (params = {}, btnType = '') => {
	if (btnType == 'batchDel') { //作废
		return Tools.callApi({url:'/api/offical/sendDoc/cancelledDoc',  method:'POST', params});
	} else if (btnType == 'back') {//撤销
		return Tools.callApi({url:'/api/offical/sendDoc/revokedDoc',  method:'POST', params});
	} else if (btnType == 'batchRejection') {//拒收
		return Tools.callApi({url:'/api/offical/receiveDoc/rejectDoc',  method:'POST', params});
	} else if (btnType == 'batchSendBack') {//退回
		return Tools.callApi({url:'/api/offical/receiveDoc/sendbackDoc',  method:'POST', params});
	}
	
}

//获取收文详情弹窗的table列表信息接口
export const getSendDocinfo = (params={})=>{
    return Tools.callApi({url:'/api/offical/sendDoc/getWebAddresseeList',  method:'POST', params});
}


//签收
export const signinDoc = (params={})=>{
    return Tools.callApi({url:'/api/offical/receiveDoc/signinDoc',  method:'POST', params});
}
